package net.hn.hnms.biz.plan.domain;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


/**
 * @author zhaoyang
 * 洗选计划实体
 * @date 2022-08-03
 */

@Data
@NoArgsConstructor
@TableName("plan_washing")
@ExcelIgnoreUnannotated
@ApiModel(value = "洗选计划实体类")
public class PlanWashing extends PlanBaseModel implements Serializable {

    private static final long serialVersionUID = 4514980649983991837L;
    /**
     * ID
     */
    @ApiModelProperty(value = "ID")
    @TableId(type = IdType.ASSIGN_UUID)
    private String washingPlanId;


    /**
     * 计划编号
     */
    @ApiModelProperty(value = "计划编号")
    @NotBlank(message = "计划编号不能为空")
    @Length(max = 100,message = "计划编号长度不能超过100个字符")
    @TableField(updateStrategy= FieldStrategy.IGNORED)
    private String washingPlanCode;

    /**
     * 计划名称
     */
    @ApiModelProperty(value = "计划名称")
    @NotBlank(message = "计划名称不能为空")
    @Length(max = 100,message = "计划名称长度不能超过100个字符")
    @TableField(updateStrategy= FieldStrategy.IGNORED)
    private String washingPlanName;

    /**
     * 计划类型 0日计划 1月计划
     */
    @ApiModelProperty(value = "计划类型 0日计划 1月计划")
    @NotBlank(message = "请选择计划类型")
    @TableField(updateStrategy= FieldStrategy.IGNORED)
    private String washingPlanType;

    /**
     * 计划开始时间
     */
    @ApiModelProperty(value = "计划开始时间")
    @NotNull(message = "请选择计划开始时间")
    @JsonFormat(
            pattern = "yyyy-MM-dd",
            timezone = "GMT+8"
    )
    @TableField(updateStrategy= FieldStrategy.IGNORED)
    private Date washingPlanStartDate;

    /**
     * 计划结束时间
     */
    @ApiModelProperty(value = "计划结束时间")
    @NotNull(message = "请选择计划结束时间")
    @JsonFormat(
            pattern = "yyyy-MM-dd",
            timezone = "GMT+8"
    )
    @TableField(updateStrategy= FieldStrategy.IGNORED)
    private Date washingPlanEndDate;

    /**
     * 计划洗选量
     */
    @ApiModelProperty(value = "计划洗选量")
    @Digits(integer = 9, fraction=2, message = "计划洗选量格式不正确")
    @DecimalMin(value = "0.00", message = "计划洗选量格式不正确")
    @TableField(updateStrategy= FieldStrategy.IGNORED)
    private BigDecimal washingPlanAmount;

}
